<template>
  <div class="release-page">
    <a-form :labelCol="{ style: 'width: 100px' }" layout="inline">
      <a-form-item label="资讯来源">
        <a-select
          allow-create
          v-model="form.source"
          placeholder="请选择或者输入"
          class="select-selection"
        >
          <a-select-option
            v-for="item in informationSource"
            :key="item"
            :label="item"
            :value="item"
          ></a-select-option>
        </a-select>
      </a-form-item>
      <a-form-item label="资讯类型">
        <a-select
          class="select-selection"
          allow-create
          v-model="form.source"
          placeholder="请选择或者输入"
        >
          <a-select-option
            v-for="item in informationSource"
            :key="item"
            :label="item"
            :value="item"
          ></a-select-option>
        </a-select>
      </a-form-item>
      <a-form-item label="所属分类">
        <a-select
          class="select-selection"
          allow-create
          v-model="form.source"
          placeholder="请选择或者输入"
        >
          <a-select-option
            v-for="item in informationSource"
            :key="item"
            :label="item"
            :value="item"
          ></a-select-option>
        </a-select>
      </a-form-item>
      <br />
      <a-form-item label="资讯标题" class="form-textarea">
        <a-input
          style="width:400px"
          allowClear
          v-model="form.title"
          placeholder="请输入标题(100字内)"
          :maxLength="100"
          type="textarea"
          :row="6"
        />
      </a-form-item>
      <br />
      <a-form-item label="资讯封面图">
        <font class="textGrey">（手机端）</font>
        <c-upload></c-upload>
      </a-form-item>
      <a-form-item label="资讯封面图">
        <font class="textGrey">（电脑端）</font>
        <c-upload></c-upload>
      </a-form-item>
      <br />
      <a-form-item label="资讯附件">
        <a-tag class="form-upload-icon" color="blue">
          <a-icon type="cloud-upload" /> <span class="font10">点击上传</span>
        </a-tag>
        <span class="textGrey">
          (仅限JPG、PNG、JPEG、PDF、PPT、Excel、Word，最多九个附件)</span
        >
      </a-form-item>
      <br />
      <a-form-item label="广告资讯">
        <a-radio-group v-model="isInformation" @change="onInformationChange">
          <a-radio :value="1">
            是
          </a-radio>
          <a-radio :value="2">
            否
          </a-radio>
        </a-radio-group>
      </a-form-item>
      <br />
      <a-form-item label="资讯详情">
        <tinymce-text
          style="width:1000px"
          id="tinymce"
          :height="600"
          ref="tinymce"
        />
      </a-form-item>
      <br />
      <a-form-model-item class="text-align-center btn-operation">
        <a-button type="primary" @click="onSubmit">
          确认发布
        </a-button>
        <a-button style="margin-left: 10px;">
          保存草稿
        </a-button>
      </a-form-model-item>
    </a-form>
  </div>
</template>

<script>
import { mapState } from "vuex";
import { getUserList } from "@/api/company/users";
import TinymceText from "@/components/Tinymce/index";

export default {
  name: "Release",
  components: { TinymceText },
  data() {
    return {
      form: {
        source: "",
        title: ""
      },
      isInformation: 1,
      informationSource: []
    };
  },
  computed: {
    ...mapState({})
  },
  created() {},
  mounted() {},
  methods: {
    onSubmit() {},
    onInformationChange() {}
  }
};
</script>

<style lang="less" scoped>
.release-page {
  padding: 26px;
  ::v-deep.ant-form-item {
    margin-bottom: 25px;
  }
  ::v-deep.ant-input {
    margin-bottom: 0px;
  }
  .btn-operation {
    width: 1100px;
  }
  .textGrey {
    font-size: 10px;
  }
  .form-textarea {
    width: 700px;
    margin-bottom: 6px;
  }
  .form-upload-icon {
    padding: 2px 5px;
  }
}
</style>




